#ifndef _TYPES_H_
#define _TYPES_H_

#include "symbol.h"

typedef struct st_semt_type *semt_type;

typedef struct st_semt_field *semt_field;

typedef struct st_semt_fieldlist *semt_fieldlist;

struct st_semt_type {
    enum { S_INT, S_CHAR, S_VOID, S_STRUCT, S_PTR } kind;
    union {
        /* S_INT, S_CHAR, S_STRING, S_VOID basic-type */
        semt_fieldlist structt;
        semt_type ptr;
    } u;
};

struct st_semt_field {
    semt_type typee;
    symbol field;
};

struct st_semt_fieldlist {
    semt_field type_field;
    semt_fieldlist next;
};

#endif